Event Processing with XML Query Based on Reusable XML Query Template

ABSTRACT

Methods, systems, and computer-readable media are disclosed for event processing with a query based on a reusable XML query template. A particular method includes receiving a plurality of events from a source and generating a plurality of event objects based on the plurality of events. A query represented by an XML file based on a reusable XML query template is executed with respect to the plurality of event objects to produce a plurality of result objects. Each result object is produced based on an application of at least one operator of the query. A plurality of results is generated based on the plurality of result objects, and the plurality of results is transmitted to a sink.

BACKGROUND

The event-based computation paradigm has grown in importance forenterprises. For example, many business applications and system controlapplications can be developed based on event-based computation.Generally, event processing applications receive events, analyze theevents, and output results (e.g., proposed actions) based on theanalysis of the events.

Current event processing systems often use structured query language(SQL) queries to analyze events. Due to the fluid nature of eventstreams, the relational algebra underlying traditional SQL may not bewell-suited for processing events at a high rate. Additionally,performing time-based calculations using the relational operatorsprovided by SQL may be difficult. Further, the semantics of a SQL querymay require recitation of specific data sources, rendering a particularSQL query that recites a particular data source unsuitable for use witha different data source.

SUMMARY

The present disclosure describes an event processing framework thatutilizes queries based on reusable XML query templates. A single XMLquery template may be reused with respect to multiple event sources andsinks. For example, an XML query template may be instantiated and boundto a particular input adapter for a particular source and to aparticular output adapter for a particular sink. To run the same queryagainst another source and another sink, the XML query template may bere-instantiated and bound to another input adapter and another outputadapter. Input adapters and output adapters for various sources andsinks may be user-defined to handle conversion to and from proprietarydata formats associated with various sources and sinks.

An XML query template may include a directed graph of operators. Theoperators may be relational algebra operators, time-based operators, orany other type of operator.

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram to illustrate a particular embodiment of asystem of event processing that uses a query based on a reusable XMLquery template;

FIG. 2 is a block diagram to illustrate another particular embodiment ofa system of event processing that uses a query based on a reusable XMLquery template;

FIG. 3 is a diagram depicting an illustrative query template that may beused with the system of FIG. 1 or the system of FIG. 2;

FIG. 4 is a flow diagram to illustrate a particular embodiment of amethod of event processing that uses a query based on a reusable XMLquery template;

FIG. 5 is a flow diagram to further illustrate event processing thatuses a query based on a reusable XML query template in accordance withthe method of FIG. 4; and

FIG. 6 is a block diagram of a computing environment including acomputing device operable to support embodiments of computer-implementedmethods, computer program products, and system components as illustratedin FIGS. 1-5.

DETAILED DESCRIPTION

In a particular embodiment, a system is disclosed that includes an inputadapter, a query engine, and an output adapter. The input adapter isconfigured to receive an event from a source and to generate an eventobject based on the event. The event object includes a payload, avalidity start time, and a validity end time. The query engine isconfigured to execute a query with respect to the event object toproduce a result object. The query is represented by an extensiblemarkup language (XML) file that is based on a reusable XML querytemplate. The XML query template is bindable to a plurality of inputadapters and to a plurality of output adapters. Result objects areproduced based on applying at least one operator of the query to aninput of the event objects. The output adapter is configured to generateresults based on the result objects and to transmit the results to asink.

In another particular embodiment, a computer-readable medium isdisclosed. The computer-readable medium includes instructions, that whenexecuted by a computer, cause the computer to receive at least one eventfrom a source at an event processing system. Each event is representedin a first data format that is native to the source. Thecomputer-readable medium also includes instructions, that when executedby the computer, cause the computer to convert the at least one eventfrom the first data format to at least one event object formatted in asecond data format. Each event object includes a payload, a validitystart time, and a validity end time. The computer-readable mediumfurther includes instructions, that when executed by the computer, causethe computer to execute a query with respect to the at least one eventobject to produce a result object. The query is executed without storingthe at least one event object and is represented by an XML file based ona reusable XML query template. The result object is based on anapplication of at least one operator of the query to the event objectand is formatted in the second data format. The computer-readable mediumincludes instructions, that when executed by the computer, cause thecomputer to convert the result object from the second data format into aresult formatted in a third data format that is native to a sink and totransmit the result to the sink.

FIG. 1 is a block diagram to illustrate a particular embodiment of anevent processing system 100 that uses an XML query based on a reusableXML query template. The system 100 is configured to receive events(e.g., an illustrative event 104) from a source 102 via a complex eventprocessing (CEP) input adapter 106 and to transmit results (e.g., anillustrative result 128) to a sink 130 via a CEP output adapter 126. Thesystem 100 includes a CEP query engine 116 configured to execute an XMLquery 118 based on a reusable XML query template. The XML query templatemay be “reusable” and “bindable” because the XML query template may beinstantiated as multiple queries, where each query is bound to aparticular input adapter and a particular output adapter. For example,the XML query 118 may be bound to the CEP input adapter 106 and the CEPoutput adapter 126. In a particular embodiment, the system 100 isincluded in a complex event processing (CEP) system.

The CEP input adapter 106 at the system 100 is configured to receiveevents, such as the event 104 from the source 102. For example, thesource 102 may include a database, a server, an event ticker, a networkport, a sensor, or some other event source that provides events to theCEP input adapter 106 periodically, randomly, or intermittently inbursts. The CEP input adapter 106 is also configured to generate (e.g.,via translation or conversion) event objects (e.g., the illustrativeevent object 110) based on the events and to transmit the generatedevent objects to the CEP query engine 116 via an input stream 108. In aparticular embodiment, the events received from the source 102 areformatted in a first data format (e.g., a proprietary data format) thatis native to the source, and the event objects are formatted in a seconddata format that is native to the system 100. In a particularembodiment, the second data format that is native to the system 100specifies that each event object 110 includes an event payload 112, anevent validity start time and an end time 114.

The CEP query engine 116 is configured to receive event objects via theinput stream 108 and to execute a query 118 with respect to the eventobjects to produce result objects (e.g., an illustrative result object124). The CEP query engine 116 is also configured to transmit the resultobject 124 to the CEP output adapter 126 via an output stream 132.

The query 118 may be represented by an XML file based on a reusable XMLquery template that is bindable to multiple input adapters and multipleoutput adapters. Thus, the query template may be reusable with multiplesources and multiple sinks, where usage of the query template with aparticular source includes binding the query template to a particularinput adapter for the particular source and usage of the query templatewith a particular sink includes binding the query template to aparticular output adapter for the particular sink. An adapter may beuser-defined and may be written in a .NET programming language againstan adapter application programming interface (API). Query templatebindings are further described with respect to FIG. 2. The query 118 mayinclude a directed graph of one or more operators 120. Operators mayinclude, but are not limited to, projection operators, windowingoperators, aggregation operators, grouping operators, join operators,and selection operators. Operators may be payload specific, validitystart time-specific, validity end-time specific, or some combinationthereof. Specific operator types are further described with respect toFIG. 3. The result object 124 is produced based on an application of theoperators 120 of the query 118 to the event object 110.

In a particular embodiment, executing the query 118 at the CEP queryengine 116 includes comparing event objects to static reference dataretrieved from a static data source 122. Event objects may also becompared to historical data (e.g., historical data of the source 102,historical data of the sink 130, historical data of the query 118, orsome other historical data) from the static data source 122. In anotherparticular embodiment, executing the query 118 at the CEP query engine116 includes storing data to the static data source 122.

In a particular embodiment, the query 118 represents a declarativequery. Generally, declarative programming languages indicate “what” isto be done (e.g., what particular inputs will be provided and whatparticular outputs will be generated) rather than “how” it is done(e.g., the underlying algebra functions and the programmatic steps toconvert the inputs into the outputs). Thus, it may be easier for usersto specify declarative queries as compared to non-declarative queries,because event-level implementation details of declarative queries maynot influence the result of declarative queries. For example, adeclarative query may be defined in a language integrated query (LINQ)language, a.NET programming language other than LINQ, or a complex eventdetection and response (CEDR) algebra. For example, an illustrative LINQquery may include:

  // filter by the value of event field SourceId and transform // theevent in the project expression var filter = from e in inputDataStream where e.SourceId == “s7”  select new { e.SourceId, ConvertedVal =e.Value * 100 };

An illustrative XML file representation of the above LINQ query mayinclude:

<QueryTemplateName=“cep:/Server/Application/ObjectModelSample/QueryTemplate/SampleQueryTemplate”xmlns=“http://schemas.microsoft.com/ComplexEventProcessing/2009/05/Metadata”>  <Import Name=“DataInput”Type=“cep:/Server/Application/ObjectModelSample/EventType/SampleReading”>   <OutputStream Name=“Import.3.0” />  </Import>  <ExportName=“_outputStream_”>   <InputStream Name=“Project.1.2” />  </Export> <Project Name=“Project.1.2”>   <InputStream Name=“Select.2.1” />  <OutputStream Name=“Project.1.2” />   <ProjectExpressionOutputField=“ConvertedVal”>    <Multiply>     <InputField Name=“Value”StreamName=“Select.2.1” />     <ConstantType=“cep:/Server/Application/system/EventType/System.Double”Value=“100” />    </Multiply>   </ProjectExpression>  <ProjectExpression OutputField=“SourceId”>    <InputFieldName=“SourceId” StreamName=“Select.2.1” />   </ProjectExpression> </Project>  <Select Name=“Select.2.1”>   <InputStream Name=“Import.3.0”/>   <OutputStream Name=“Select.2.1” />   <FilterExpression>    <Equal>    <InputField Name=“SourceId” StreamName=“Import.3.0” />     <ConstantType=“cep:/Server/Application/system/EventType/System.String” Value=“s7”/>    </Equal>   </FilterExpression>  </Select> </QueryTemplate>

In a particular embodiment, executing the query 118 at the CEP queryengine 116 includes parsing the XML file representing the query inaccordance with one or more XML schema definition (XSD) files. Forexample, such XSD files useable to parse XML queries may be availablefrom Microsoft Corp. at 1, Microsoft Way Redmond, Wash. 98052.

In a particular embodiment, the CEP query engine 116 is configured toprovide “in-flight” processing of event objects. That is, the CEP queryengine 116 may receive event objects, execute the query 118, andtransmit produced result objects without storing the event objects orthe result objects in a memory of the system 100. In a particularembodiment, support for in-flight processing enables the system 100 toprocess hundreds of thousands of event objects per second, or more.

The CEP output adapter 126 at the system 100 is configured to transmitresults such as the result 128 to the sink 130. The CEP output adapter126 is also configured to generate (e.g., via translation or conversion)the results based on result objects (e.g., the result object 124)received from the CEP query engine 116 via the output stream 132. In aparticular embodiment, result objects received from the query engine arein the second data format native to the system 100 and the results areformatted in a third data format (e.g., another proprietary data format)that is native to the sink 130. The sink 130 may include acommunications device, a mobile device, a computer system, a database, aserver, an event store, or some other consumer of results produced bythe system 100.

In a particular embodiment, the CEP input adapter 106 and the CEP outputadapter 126 are coupled to network interfaces, such as a wired interface(e.g., Ethernet), a wireless interface (e.g., IEEE 802.11a/b/g/n), orsome other network interface. In another particular embodiment, one ormore of the source 102 and the sink 130 may be local to a computersystem that includes the system 100 of FIG. 1.

In a particular embodiment of operation, the CEP input adapter 106 mayreceive the event 104 from the source 102 and generate an event object110 based on the event 104. The event object includes an event payload112 and validity start/end times 114. The CEP query engine 116 mayexecute the query 118 with respect to the event object 110 to generatethe result object 124. The query may be represented by an XML file thatis based on a reusable XML query template (e.g., generated based on aLINQ query). The CEP output adapter 126 may generate a result 128 basedon the result object 124 and may transmit the result 128 to the sink 130

It will be appreciated that the system 100 of FIG. 1 may enable eventprocessing using XML queries based on reusable XML query templates.Thus, the system 100 of FIG. 1 may enable a user to define a querywithout reciting specific sources or sinks and without depending ontechnology-specific operations associated with the specific sources orsinks. It will further be appreciated that the system 100 of FIG. 1 mayprovide such event processing functionality in various embodiments. Forexample, the system 100 of FIG. 1 may be integrated into an embeddeddynamically linked library (DLL), an executable file, an operatingsystem service, or a server farm.

FIG. 2 is a block diagram to illustrate another particular embodiment ofan event processing system 200 that uses an XML query based on areusable XML query template. The system 200 is configured to receiveevents (e.g., an illustrative first event 204 and a third event 206transmitted subsequent to the first event 204) from a first source 202and to receive events (e.g., an illustrative second event 210) from asecond source 208. The system 200 is also configured to transmit results(e.g., an illustrative first result 228) to a first sink 230 and totransmit results (e.g., an illustrative second result 232) to a secondsink 234. The system 200 includes a complex event processing (CEP) queryengine configured to execute XML queries (e.g., illustrative CEP queries220, 222) based on a reusable XML query template.

A first CEP input adapter 212 at the system 200 may receive events fromthe first source 202, produce event objects 216 based on the events, andtransmit the event objects 216 to the CEP query engine 218 as describedherein with reference to the CEP input adapter 106 of FIG. 1. Similarly,a second CEP input adapter 214 at the system 200 may receive events fromthe second source 208, produce event objects 216 based on the events,and transmit the event objects 216 to the CEP query engine 218 asdescribed herein with reference to the CEP input adapter 106 of FIG. 1.

The CEP query engine 218 is configured to receive event objects 216 fromthe CEP input adapters and execute the CEP queries 220, 222 with respectto the event objects 216 to produce result objects 236. The CEP queryengine 218 is also configured to transmit the result objects 236 to theCEP output adapters 224, 226. The CEP queries 220, 222 may berepresented by XML files and may be based on the same XML querytemplate. That is, the first CEP query 220 may be an instantiation ofthe XML query template bound to the first CEP input adapter 212 and thefirst CEP output adapter 224, and the second CEP query 222 may be aninstantiation of the XML query template bound to the second CEP inputadapter 214 and the second CEP output adapter 226.

It should be noted that CEP queries may not be limited to producing asingle result object for each event object. Depending on the particularoperator(s) in the query, any number of result objects may be producedfrom a single event object, and any number of event objects may beconsumed in producing a single result object. For example, a resultobject may be produced by executing a query with respect to multipleevents objects of a particular stream(e.g., a first event object basedon the first event 204 and a second event object based on the thirdevent 206).

In a particular embodiment, when the CEP queries 220, 222 areinstantiations of the same XML query template, the event objects 216produced by the CEP input adapters 212, 214 are identically typed. Theresult objects 236 transmitted to the CEP output adapters 224, 226 arealso identically typed. For example, if a directed graph of operators inthe XML query template accepts as input one integer value and twofloating point values, each of the CEP input adapters 212, 214 produceevent objects that include one integer value and two floating values asthe event object payload. As another example, if the directed graph ofoperators in the XML query template produces as an output a singleBoolean value, each of the CEP output adapters 224, 226 will acceptresult objects that include a single Boolean value as the result objectpayload. Thus, any user-defined input adapter (and by extension, eventsource) may be bound to an XML query template, provided that theuser-defined input adapter produces event objects that fulfill data typeexpectations of the XML query template. Similarly, any user-definedoutput adapter (and by extension, result sink) may be bound to an XMLquery template, provided that the user-defined output adapter acceptsresult objects that include data types produced by the XML querytemplate. It should be noted that although the particular embodimentillustrated in FIG. 2 depicts identically typed event objects, eventobjects from input adapters may be dissimilarly typed. For example, whena query template is bound to multiple input streams that are combinedvia query logic (e.g., a join operator), the event objects transmittedby the input adapters may not be identically typed.

An illustrative embodiment of an XML file that represents a bound querymay include:

<?xml version=“1.0” encoding=“utf-8” ?> <Query xmlns=“http://schemas.microsoft.com/ComplexEventProcessing/ 2009/10/Metadata” Name=“cep:/Server/Application/app1/Query/AdvanceTimeEdge” QueryTemplate=“cep:/Server/Application/app1/QueryTemplate/ AdvanceTimeQueryTemplate” Description=“”> <OutputStreamBindingOutputStream =“OutputStream” OutputStreamTarget=“cep:/Server/Application/app1/OutputAdapter/ MultiShapeOutputAdapter” StreamEventOrdering=“ChainOrdered” EventShape=“Edge”>  <AdapterConfiguration>   <MyOutputAdapterConfig>   <FileName>AdvanceTimeEdgeOutput.txt</FileName>   <EventCount>39</EventCount>   <SignalEventName>AdvanceTimeEdgeComplete</Signal    EventName>   </MyOutputAdapterConfig>  </AdapterConfiguration></OutputStreamBinding> <InputStreamBinding InputStream=“InputStream” InputStreamSource=“cep:/Server/Application/app1/InputAdapter/ MultiShapeInputAdapter” EventShape=“Edge”>  <AdvanceTimePolicy=“Adjust”>   <EventCountFrequency Value=“1” />   <DurationSlackValue=“PT0.000S” />  </AdvanceTime>  <AdapterConfiguration>  <MyInputAdapterConfig>   <FileName>AdvanceTimeEdgeInput.txt</FileName>  </MyInputAdapterConfig>  </AdapterConfiguration> </InputStreamBinding></Query>

The first CEP output adapter 224 at the system 200 may receive resultobjects 236 from the query engine 218, produce results (e.g., the firstresult 228) based on the result objects 236, and transmit the results tothe first sink 230 as described herein with reference to the CEP outputadapter 126 of FIG. 1. Similarly, the second CEP output adapter 226 atthe system 200 may receive result objects 236 from the query engine 218,produce results (e.g., the second result 232) based on the resultobjects 236, and transmit the results to the second sink 234 asdescribed herein with reference to the CEP output adapter 126 of FIG. 1.

In a particular embodiment of operation, the first CEP input adapter 212may generate event objects 216 based on events (e.g., the first event204 and the third event 206) received from the first source 202, and thesecond CEP input adapter 214 may generate event objects 216 based onevents (e.g., the second event 210) received from the second source 208.The event objects 216 are identically typed. The CEP query engine mayexecute a first CEP query 220 bound to the first CEP input adapter 212and to the first CEP output adapter 224 to generate result objects 236that are transmitted to the first CEP output adapter 224. The CEP queryengine may also execute a second CEP query 222 bound to the second CEPinput adapter 214 and to the first CEP output adapter 226 to generateresult objects 236 that are transmitted to the second CEP output adapter226. The result objects 236 may be identically typed. The first CEPoutput adapter 224 may transmit results (e.g., the first result 228) tothe first sink 230 and the second CEP output adapter 226 may transmitresults (e.g., the second result 232) to the second sink 234

In a particular embodiment, the first CEP query 220 and the second CEPquery 222 execute simultaneously. In another particular embodiment, thefirst CEP query 220 executes during a first time period and the secondCEP query 222 executes during a second time period (e.g., subsequent tothe first time period).

It will be appreciated that the system 200 of FIG. 2 may enable theinstantiation of multiple queries based on the same query template. Itwill further be appreciated that the instantiations (and theinput/output adapters bound to the instantiations) may executesimultaneously or successively.

FIG. 3 is a diagram depicting an illustrative query template 300 thatmay be used with the system of FIG. 1 or the system of FIG. 2. Forexample, the query template 300 may be the basis for the query 118 ofFIG. 1 or the CEP queries 220, 222 of FIG. 2.

A query template may be viewed as a computational assembly line, wherethe input of the assembly line is attached to an input adapter and theoutput of the assembly line is attached to an output adapter. Toillustrate the use of the query template 300, consider a plurality ofpower meters configured to measure power consumption (in watts) by aparticular machine component. Each of the power meters may function asan event source for an event processing system and my transmit powerdata 302 to the event processing system in the form of events, whereevents from a particular power meter include wattage readings from theparticular power meter. The power meters may produce multiple eventobjects per second.

An input adapter 304 of the event processing system may generate eventobjects (e.g., the illustrative event object 306) based on the powerdata 302. Each such event object may include as payload an integer powermeter identifier (ID) and an integer wattage reading (W, a fixed pointreading measured in tenths of Watts), where the ID identifies theparticular power meter that produced the wattage reading W. Each suchevent object includes a validity start time and a validity end time (notshown).

The event objects generated by the input adapter 304 may be transmittedto a query execution engine that is configured to execute a query basedon the query template 300. That is, the query execution engine may beconfigured to execute an instantiation of the query template that isbound to the input adapter 304 and to an output adapter 322. The querytemplate 300 may include a directed graph of operators. For example, inthe particular embodiment illustrated in FIG. 3, the operators include aprojection operator 308, a hopping window operator 310, a groupingoperator 312, a first aggregation operator 314, a second aggregationoperator 316, and a join operator 318. In general, the query template300 may be configured to perform the following calculation logic:“First, divide every received wattage value by 10 to convert the fixedpoint reading to Watts. Then apply a hopping window of one second to theobjects. Next, group the objects by power meter ID and average thewattage readings separately for each group (i.e., average each powermeter separately). Calculate the total sum of all such average valuesover all meters and use that calculated total sum to compute a ratio ofwattage consumption reported by a particular power meter to overallwattage consumption (i.e., how much power each machine componentassociated with each power meter contributes to the overall consumptionof the machine).”

In accordance with the above logic, during operation of the eventprocessing system, the projection operator 308 may generate anintermediate value “Wattage=W/10.” Next, the hopping window operator 310may apply a one second window to the calculation (e.g., collect eventobjects with validity start times within the last second). The groupingoperator 312 may then partition the collection of event objects by powermeter ID, and the aggregation operator 314 may compute a value “w” foreach power meter, where “w” for a particular power meter represents theaverage power consumption of the particular power meter over theprevious one second. The second aggregation operator 316 may compute avalue “wSum” that represents a sum of the “w” value for all powermeters. Finally, a join operator 318 may compute a value “Ratio=w/wSum”representing the ratio of power consumption reported by the power meterassociated with the event object 306 to total power consumption of allpower meters.

The query template 300 may produce result objects (e.g., theillustrative result object 320) having as payload an integer power meteridentifier (ID), a floating point wattage reading (W), and a floatingpoint power consumption ratio (Ratio). The result objects may betransmitted by the query execution engine to an output adapter 322, andthe output adapter may transmit result data 324 to a client of the eventprocessing system. For example, the client may be a power throttlingcomputer configured to selectively down-throttle power provided to aparticular machine component in response to receiving result data 324indicating that the particular machine component is consuming over 50%of total power.

FIG. 4 is a flow diagram to illustrate a particular embodiment of amethod 400 of event processing with a query based on a reusable XMLquery template. In an illustrative embodiment, the method 400 mayperformed by the system 100 of FIG. 1 or the system 200 of FIG. 2.

The method 400 includes, at a system including a processor and a memory,receiving a plurality of events from a source, at 402. For example, theplurality of events may be received periodically, randomly,intermittently in bursts, or in some other fashion. For example, in FIG.1, the system 100 may receive a plurality of events including event 104from the source 102.

The method 400 also includes generating a plurality of event objectsbased on the plurality of events, at 404. For example, in FIG. 1, theCEP input adapter 106 may generate a plurality of event objectsincluding illustrative event object 110 based on the plurality ofevents.

The method 400 further includes, at the processor, executing a querywith respect to the plurality of event objects to produce a plurality ofresult objects, at 406. The query is executed without storing any of theplurality of event objects at the memory and the query is represented byan XML file that is based on a reusable XML query template. Each of theplurality of result objects is based on an application of at least oneoperator of the query. For example, in FIG. 1, the CEP query engine 116may execute the query 118 with respect to the plurality of event objectsto produce a plurality of result objects, where the query 118 isrepresented by an XML file based on a reusable XML query template. Theresult object 124 may be produced by executing the query 118 withrespect to the event object 110, including applying the operators 120 ofthe query 118 to the event object 110.

The method 400 includes generating a plurality of results based on theplurality of result objects, at 408. For example, in FIG. 1, the CEPoutput adapter 126 may generate a plurality of results includingillustrative result 128 based on the plurality of result objects. Themethod 400 also includes transmitting the plurality of results to asink, at 410. For example, in FIG. 1, the plurality of results may betransmitted to the sink 130.

FIG. 5 is a flow diagram to further illustrate event processing using aquery based on a reusable XML query template in accordance with themethod 400 of FIG. 4. In an illustrative embodiment, the method 500 ofFIG. 5 may be performed by the system 100 of FIG. 1 or the system 200 ofFIG. 2.

The method 500 includes, at a system, receiving at least one event froma source, where the event is represented in a first data format that isnative to the source, at 502. For example, in FIG. 1, the CEP inputadapter 106 may receive the event 104 from the source 102, where theevent 104 is represented in a first data format that is native to thesource 102.

The method 500 also includes converting the at least one event from thefirst data format to at least one event object formatted in a seconddata format, at 504. The at least one event object includes a payload, avalidity start time, and a validity end time. For example, in FIG. 1,the CEP input adapter 106 may convert the event 104 to the event object110, where the event object 110 is formatted in a second data format andincludes the event payload 112 and the event validity start/end times114.

The method 500 further includes executing a query with respect to the atleast one event object to produce a result object, at 506. The query isexecuted without storing the at least one event object, and the query isrepresented by an XML file that is based on a reusable XML querytemplate. The result object is produced based on an application of atleast one operator of the query and is formatted in the second dataformat. For example, in FIG. 1, the CEP query engine 116 may execute thequery 118 with respect to the event object 110 to produce the resultobject 124 without storing the event object 110, where the query isrepresented by an XML file based on a reusable XML query template andwhere the result object 124 is produced based on application of theoperators 120 to the event object 110. The result object 124 may beformatted in the second data format.

The method 500 includes converting the at least one result object fromthe second data format to at least one result formatted in a third dataformat that is native to a sink, at 508. For example, in FIG. 1, the CEPoutput adapter 126 may convert the result object 124 to the result 128,where the result 128 is formatted in a third data format that is nativeto the sink 130. The method 500 includes transmitting the at least oneresult to the sink, at 510. For example, in FIG. 1, the CEP outputadapter 126 may transmit the result 128 to the sink 130.

It will be appreciated that with a reusable query template, the method500 of FIG. 5 may enable users to reuse the XML query template with anew source or a new sink by simply encapsulating the conversion logic totranslate to and from the data of the new source or the new sink into anew input adapter or a new output adapter.

FIG. 6 depicts a block diagram of a computing environment 600 includinga computing device 610 operable to support embodiments ofcomputer-implemented methods, computer program products, and systemcomponents according to the present disclosure. In an illustrativeembodiment, the computing device 610 may include one or more of the CEPinput adapter 106 of FIG. 1, the CEP output adapter 126 of FIG. 1, theCEP input adapters 212, 214 of FIG. 2, the CEP output adapters 224, 226of FIG. 2, the CEP query engine 116 of FIG. 1, and the CEP query engine218 of FIG. 2. Each of the CEP input adapter 106 of FIG. 1, the CEPoutput adapter 126 of FIG. 1, the CEP input adapters 212, 214 of FIG. 2,the CEP output adapters 224, 226 of FIG. 2, the CEP query engine 116 ofFIG. 1, and the CEP query engine 218 of FIG. 2 may include or beimplemented using the computing device 610 or a portion thereof.

The computing device 610 includes at least one processor 620 and asystem memory 630. Depending on the configuration and type of computingdevice, the system memory 630 may be volatile (such as random accessmemory or “RAM”), non-volatile (such as read-only memory or “ROM,” flashmemory, and similar memory devices that maintain stored data even whenpower is not provided), or some combination of the two. The systemmemory 630 typically includes an operating system 632, one or moreapplication platforms 634, one or more applications (e.g., a queryengine 636), and may include program data 638 associated with the one ormore applications. In an illustrative embodiment, the query engine 636is the CEP query engine 116 of FIG. 1 or the CEP query engine 218 ofFIG. 2.

The computing device 610 may also have additional features orfunctionality. For example, the computing device 610 may also includeremovable and/or non-removable additional data storage devices such asmagnetic disks, optical disks, tape, and standard-sized or miniatureflash memory cards. Such additional storage is illustrated in FIG. 6 byremovable storage 640 and non-removable storage 650. Computer storagemedia may include volatile and/or non-volatile storage and removableand/or non-removable media implemented in any method or technology forstorage of information such as computer-readable instructions, datastructures, program components or other data. The system memory 630, theremovable storage 640 and the non-removable storage 650 are all examplesof computer storage media. The computer storage media includes, but isnot limited to, RAM, ROM, electrically erasable programmable read-onlymemory (EEPROM), flash memory or other memory technology, compact disks(CD), digital versatile disks (DVD) or other optical storage, magneticcassettes, magnetic tape, magnetic disk storage or other magneticstorage devices, or any other medium that can be used to storeinformation and that can be accessed by the computing device 610. Anysuch computer storage media may be part of the computing device 610.

The computing device 610 also contains one or more communicationconnections 680 that allow the computing device 610 to communicate withother computing devices (e.g., an input source 690, an output sink 692,and a static data source 694) over a wired or a wireless network. In anillustrative embodiment, the communication connections 680 include theadapters 106, 126 of FIG. 1 or the adapters 212, 214, 224, 226 of FIG.2. In another illustrative embodiment, the source 690 is the source 102of FIG. 1, the first source 202 of FIG. 2, or the second source 208 ofFIG. 2. In another illustrative embodiment, the sink 692 is the sink 130of FIG. 1, the first sink 230 of FIG. 2, or the second sink 234 of FIG.2. In another illustrative embodiment, the static data source 694 is thestatic data source 122 of FIG. 1.

It will be appreciated that not all of the components or devicesillustrated in FIG. 6 or otherwise described in the previous paragraphsare necessary to support embodiments as herein described. For example,the removable storage 640 and non-removable storage 650 may be optional.

The illustrations of the embodiments described herein are intended toprovide a general understanding of the structure of the variousembodiments. The illustrations are not intended to serve as a completedescription of all of the elements and features of apparatus and systemsthat utilize the structures or methods described herein. Many otherembodiments may be apparent to those of skill in the art upon reviewingthe disclosure. Other embodiments may be utilized and derived from thedisclosure, such that structural and logical substitutions and changesmay be made without departing from the scope of the disclosure.Accordingly, the disclosure and the figures are to be regarded asillustrative rather than restrictive.

Those of skill would further appreciate that the various illustrativelogical blocks, configurations, modules, and process or instructionsteps described in connection with the embodiments disclosed herein maybe implemented as electronic hardware, computer software, orcombinations of both. Various illustrative components, blocks,configurations, modules, or steps have been described generally in termsof their functionality. Whether such functionality is implemented ashardware or software depends upon the particular application and designconstraints imposed on the overall system. Skilled artisans mayimplement the described functionality in varying ways for eachparticular application, but such implementation decisions should not beinterpreted as causing a departure from the scope of the presentdisclosure.

The steps of a method described in connection with the embodimentsdisclosed herein may be embodied directly in hardware, in a softwaremodule executed by a processor, or in a combination of the two. Asoftware module may reside in computer readable media, such as randomaccess memory (RAM), flash memory, read only memory (ROM), registers, ahard disk, a removable disk, a CD-ROM, or any other form of storagemedium known in the art. An exemplary storage medium is coupled to theprocessor such that the processor can read information from, and writeinformation to, the storage medium. In the alternative, the storagemedium may be integral to the processor or the processor and the storagemedium may reside as discrete components in a computing device orcomputer system.

Although specific embodiments have been illustrated and describedherein, it should be appreciated that any subsequent arrangementdesigned to achieve the same or similar purpose may be substituted forthe specific embodiments shown. This disclosure is intended to cover anyand all subsequent adaptations or variations of various embodiments.

The Abstract of the Disclosure is provided with the understanding thatit will not be used to interpret or limit the scope or meaning of theclaims. In addition, in the foregoing Detailed Description, variousfeatures may be grouped together or described in a single embodiment forthe purpose of streamlining the disclosure. This disclosure is not to beinterpreted as reflecting an intention that the claimed embodimentsrequire more features than are expressly recited in each claim. Rather,as the following claims reflect, inventive subject matter may bedirected to less than all of the features of any of the disclosedembodiments.

The previous description of the embodiments is provided to enable aperson skilled in the art to make or use the embodiments. Variousmodifications to these embodiments will be readily apparent to thoseskilled in the art, and the generic principles defined herein may beapplied to other embodiments without departing from the scope of thedisclosure. Thus, the present disclosure is not intended to be limitedto the embodiments shown herein but is to be accorded the widest scopepossible consistent with the principles and novel features as defined bythe following claims.

1. A system, comprising: an input adapter configured to receive an eventfrom a source and generate an event object based on the event, whereinthe event object includes a payload, a validity start time, and avalidity end time; a query engine configured to execute a query withrespect to the event object to produce a result object, wherein thequery is represented by an extensible markup language (XML) file that isbased on a reusable XML query template that is bindable to a pluralityof input adapters and a plurality of output adapters, wherein the resultobject is produced based on an application of at least one operator ofthe query; and an output adapter configured to generate a result basedon the result object and to transmit the result to a sink.
 2. The systemof claim 1, further comprising a second input adapter configured toreceive a second event from a second source that is different from thefirst source and a second output adapter configured to transmit a secondresult to a second sink that is different from the first sink, whereinthe query engine is further configured to execute the query with respectto the second event object.
 3. The system of claim 2, wherein executingthe query with respect to the event includes binding a first instance ofthe query template to the input adapter and to the output adapter,wherein executing the query with respect to the second event objectincludes binding a second instance of the query template to the secondinput adapter and to the second output adapter, and wherein both thefirst input adapter and the second input adapter produce identicallytyped event objects in accordance with a type specification of the querytemplate.
 4. The system of claim 1, wherein the input adapter is furtherconfigured to receive a second event from the source and wherein thequery engine is further configured to execute the query with respect toa combination of the event object and a second event object based on thesecond event.
 5. The system of claim 1, wherein the query template isreusable with multiple sources and multiple sinks and wherein the queryengine is further configured to execute the query with respect to theevent object without storing the event object.
 6. The system of claim 1,wherein the input adapter transmits the event object to the query enginevia an input stream.
 7. The system of claim 1, wherein the outputadapter receives the result object from the query engine via an outputstream.
 8. The system of claim 1, wherein the XML file includes adirected graph of the at least one operator.
 9. The system of claim 8,wherein the directed graph includes a projection operator, a windowingoperator, an aggregation operator, a grouping operator, a join operator,a selection operator, or any combination thereof.
 10. The system ofclaim 1, wherein the source provides events to the input adapterperiodically, randomly, or intermittently in bursts.
 11. The system ofclaim 1, wherein the event is formatted in a first data format native tothe source, wherein the event object and the result object are formattedin a second data format native to the query engine, and wherein theresult is formatted in a third data format native to the sink.
 12. Thesystem of claim 1, wherein the XML file representing the query isgenerated based on a language integrated query (LINQ) language, a queryin a.NET programming language other than LINQ, a complex event detectionand response (CEDR) algebra query, or any combination thereof.
 13. Thesystem of claim 1, wherein the system is integrated into an embeddeddynamically linked library (DLL), an executable file, an operatingsystem service, or a server farm.
 14. The system of claim 1, wherein atleast one of the input adapter, the query engine, and the output adapterare integrated into a complex event processing (CEP) system.
 15. Thesystem of claim 1, wherein the input adapter generates event objectsthat match an input type specification of the XML query template andwherein the output adapter accepts result objects that match an outputtype specification of the XML query template.
 16. A method, comprising:at a complex event processing (CEP) system comprising a processor andmemory, receiving a plurality of events from a source; generating aplurality of event objects based on the plurality of events; at theprocessor, executing a query with respect to the plurality of eventobjects to produce a plurality of result objects, wherein the query isexecuted without storing any of the plurality of event objects at thememory, wherein the query is represented by an extensible markuplanguage (XML) file that is based on a reusable XML query template, andwherein each of the plurality of result objects is produced based on anapplication of at least one operator of the query; generating aplurality of results based on the plurality of result objects; andtransmitting the plurality of results to a sink.
 17. The method of claim16, wherein the XML file representing the query indicates an inputbinding to the input adapter and an output binding to the outputadapter.
 18. A computer-readable medium comprising instructions, thatwhen executed by a computer, cause the computer to: receive, at an eventprocessing system, at least one event from a source, wherein each eventis represented in a first data format that is native to the source;convert the at least one event from the first data format to at leastone event object formatted in a second data format, the at least oneevent object including a payload, a validity start time, and a validityend time; execute a query with respect to the at least one event objectto produce a result object, wherein the query is represented by anextensible markup language (XML) file that is based on a reusable XMLquery template, wherein the result object is produced based on anapplication of at least one operator of the query, and wherein theresult object is formatted in the second data format; convert the resultobject from the second data format to at least one result formatted in athird data format that is native to a sink; and transmit the at leastone result to the sink.
 19. The computer-readable medium of claim 18,wherein the at least one operator is a payload-specific operator, avalidity start time-specific operator, a validity end time-specificoperator, or any combination thereof.
 20. The computer-readable mediumof claim 18, wherein executing the query includes parsing the XML filerepresenting the query in accordance with one or more XML schemadefinition (XSD) files.